Mating disrupts morning anticipation in Drosophila melanogaster females

After mating, the physiology of Drosophila females undergo several important changes, some of which are reflected in their rest-activity cycles. To explore the hypothesis that mating modifies the temporal organization of locomotor activity patterns, we recorded fly activity by a video tracking method. Monitoring rest-activity patterns under light/dark (LD) cycles indicated that mated females lose their ability to anticipate the night-day transition, in stark contrast to males and virgins. This postmating response is mediated by the activation of the sex peptide receptor (SPR) mainly on pickpocket (ppk) expressing neurons, since reducing expression of this receptor in these neurons restores the ability to anticipate the LD transition in mated females. Furthermore, we provide evidence of connectivity between ppk+ neurons and the pigment-dispersing factor (PDF)-positive ventral lateral neurons (sLNv), which play a central role in the temporal organization of daily activity. Since PDF has been associated to the generation of the morning activity peak, we hypothesized that the mating signal could modulate PDF levels. Indeed, we confirm that mated females have reduced PDF levels at the dorsal protocerebrum; moreover, SPR downregulation in ppk+ neurons mimics PDF levels observed in males. In sum, our results are consistent with a model whereby mating-triggered signals reach clock neurons in the fly central nervous system to modulate the temporal organization of circadian behavior according to the needs of the new status.


Introduction
In most animals, endogenous circadian clocks coordinate physiological and behavioral processes to keep the entire organism in synchrony with the 24 hours day-night cycling environment. In Drosophila melanogaster the circadian clock is composed by approximately 150 neurons, where the levels of clock-related proteins oscillate with periods close to 24 hours. These neurons are organized in different clusters [1,2] whose interaction is necessary for a coherent and plastic control of behavior [3]. The ventrolateral neurons (LNvs) are important because they drive rhythmicity under free-running conditions [4][5][6][7], mostly through the release of pigment dispersing factor (PDF), a neuropeptide expressed in the small (sLNvs) and large (lLNvs) which is key for the communication between them and other group of the clock neurons [5][6][7][8].
In many species, mating induces changes in the behavior and physiology of females; these changes are known as postmating responses (PMR). In Drosophila females, mating induces a reduction in partner receptivity [9,10], an increase in egg production and oviposition [11], stimulation of the immune response [12] and changes in sleep and activity patterns [13,14], as well as in nutritional preferences [15]. These PMRs are mediated by the sex peptide (SP), transferred from males to females during mating [16,17]. SP acts mostly via the sex peptide receptor (SPR), on a small number of uterine sex peptide sensory neurons (SPSN) that co-express the sex-determination genes doublesex (dsx), fruitless (fru), and pickpocket (ppk), triggering various PMRs [17][18][19]. It has also been suggested that SP could act via the hemolymph [20], which is consistent with SPR being expressed broadly in the CNS [21].
Fruit flies display two activity bouts, one at dawn ("morning peak") and the other at dusk ("evening peak"). The early start of the morning activity peak shows that flies can anticipate the transition between night and day. Mated females usually have greater activity than virgin females and males, and less daytime sleep [13,14], a change modulated mainly by SP through SPR within SPSN and Sex Peptide Abdominal Ganglion (SAG) neurons [22]. This PMR has also been observed in females of other Drosophila species such as D. suzukii [23]. In general, sleep is not only regulated by the circadian clock, but also by a homeostatic process [24], even in Drosophila [25]. Thus, the reduction of daytime sleep displayed by mated females could be due to an interference with any of these two processes. An important question is whether the mating status can influence the circadian clock to modify the temporal behavior of mated females.
We show here that mated females lose their ability to anticipate the night-day transition, a clear output of the circadian clock. This PMR is probably mediated by SP acting on ppk+ neurons, since decreased expression of SPR in these neurons restores morning anticipation in mated females. We searched for projections of ppk+ expressing neurons near circadian clusters and found that the pdf+ sLNvs are postsynaptic targets of ppk+ neurons. This connection, along with the relationship between PDF and morning anticipation [4], suggested that ppk+ neurons are involved in the inhibition of either expression or transport of PDF. Accordingly, we found that PDF levels are reduced in the dorsal termini of mated females, which can be partially rescued through downregulation of SPR in ppk+ neurons. Thus, our results are consistent with a model whereby mating-triggered signals are delivered to the clock network in order to modulate the temporal organization of the behavior.

Mating induces loss of morning anticipation in mated females
Locomotor activity has been extensively studied in males, but much less in female (mated or virgin) flies, and most published studies were performed using the Drosophila Activity Monitor tracking system (DAM, Trikinetics). On this system, flies are housed in small tubes (¬320 mm 3 ), and their movement is recorded only when they cross an infrared beam. It has been reported [26] though, that activity records differ between DAM and the more accurate video tracking systems. Moreover, activity of mated flies depends on the size of the arena where they are placed [26]. Thus, in order to provide mated females with a more adequate environment where movement can be accurately recorded, we developed a system where flies are placed in a set of relatively large transparent chambers (80 x 8 x 8 mm), and are tracked using a video system (for a detailed description please refer to the Methods section). In order to validate our setup, we compared the activity recorded by our video tracking method, which directly measures activity as distance travelled per second, with recordings obtained using the DAM system, which estimates activity as the number of interruptions of a single infrared beam, firstly in male flies. Both methods show that flies display bimodal locomotor activity patterns over several 12 h: 12 h LD cycles, and no significant differences were found in the morning anticipation activity between both systems (S1A- S1C Fig). However, a close examination of their sleep pattern revealed that flies seem to sleep significantly more when locomotor activity is monitored using the DAM system than when they are registered using our video tracking method (S1D and S1E Fig). This is probably because the DAM system fails to detect a portion of the activity that flies display along the day, for instance when they stand on one side of the tube, without crossing the infrared beam, likely resulting in an overestimation of sleep duration. These results confirm that even though single-fly recordings generated either by the DAM system and our system produce highly similar locomotor activity profiles, validating our experimental setup, video tracking acquisition provides more accurate register of the activity patterns.
Next, we compared the locomotor activity of males, virgin and mated females of different control laboratory lines, white (w 1118 ), Oregon R (OreR) and Canton-S (CS) under 12 h: 12 h LD cycles. Fig 1A shows the average activity profile (AAP) for males, virgin and mated females of w 1118 flies. Male flies have two pronounced peaks of daily activity that start in anticipation to the lights-on and lights-off transitions, separated by a relatively long interval with very low activity (siesta). In contrast, mated females displayed a sustained and robust activity during daytime while at night the activity remains as low as in males. Virgin females, on the other hand, are more active than males during daytime but less so than mated females [13,14]. A closer visual inspection of AAPs showed that males and virgin females have a gradual increase in activity before lights-on (termed morning anticipation), whereas mated females did not display this morning anticipation, but they had a high amplitude morning startle response coincident with lights-on (Fig 1B). A more quantitative assessment of the degree of anticipation is given by the morning anticipation index (MAI, defined in Materials and Methods) [27]. Fig  1C shows a significant reduction in MAI in mated females compared with males supporting a strongly dimorphic trait. Additionally, the figure shows that mated females display a significant reduction in MAI when compared to virgin females, to the point that morning anticipation is virtually suppressed (on average), suggesting a postmating effect. Interestingly, all three control strains showed a reduced morning anticipation in mated females, supporting the idea that this effect occurs across different genetic backgrounds. Thus, our data shows that one of the postmating responses characteristic of mated females is the suppression of their ability to anticipate the night-day transition. In this article we focus on characterizing this postmating behavior.

Loss of morning anticipation is mediated by sex peptide in ppk+ neurons
Although SPR is detected broadly on the female reproductive tract, the ventral nerve cord and the brain [21], only a restricted subset of fru+/ppk+/dsx+ sex peptide sensory neurons (SPSN) expressing SPR in the reproductive system are necessary and sufficient to induce some SPmediated postmating responses [17][18][19]. To examine whether SPSN neurons are involved in the modulation of morning anticipation through SP signaling, we evaluated the impact of SPR downregulation by RNA interference (RNAi) (21) on activity patterns of mated females. As expected, SPR downregulation in SPSN neurons induced a significant increase in morning anticipation compared with mated controls (Fig 2A).
Some PMRs are controlled by a larger group of neurons than the SPSN. For example, oviposition recruits more dsx+ neurons that the ones present in the SPSN [19,20]. Likewise, fru+ neurons control many sexual behaviors in males and females [28]. Additionally, whereas SPSN neurons communicate with the brain using an indirect pathway (that passes through SAG neurons) it has been reported that some ppk+ neurons project directly to the brain [29], the main center of circadian control. For these reasons we decided to study separately the effect of the downregulation of SPR in each of these three neuronal groups.  SPR knock down in fru+ and dsx+ neurons resulted in a significant increase in the MAI compared to mated controls (Fig 2B and 2C). This increase in MAI was similar to the value obtained when SPR expression was reduced in SPSN neurons. However, SPR knock down in ppk+ neurons resulted in a dramatic increase in this index (Fig 2D) suggesting a distinctive role of ppk+ neurons in the control of this postmating response. Remarkably, we did not observe any significant difference in morning anticipation when we downregulated SPR in ppk+ neurons in virgin females. Since all virgin genotypes have morning anticipation, the regulation by SPR is indeed mating-state-dependent (Fig 2E). These findings demonstrate the need for SPR function in SPSN neurons to respond to and transmit SP-generated signals to control morning anticipation in mated females and also support the hypothesis that additional spr+ ppk+ neurons beyond the SPSN domain play a role in the modulation of morning anticipation (Fig 2F). Interestingly these additional neurons do not seem to play any role in the control of the loss of daytime sleep (S2 Fig) which is a different PMR that has been reported to be regulated by the action of SP in the SPSN neurons [22].
Since the SPSN neurons contact the central brain indirectly, as it passes through neurons in the abdominal ganglion [17][18][19]30], and that some ppk+ neurons have been shown to project to the brain [29], we wondered if ppk+ neurons that control morning anticipation could provide an additional, more direct route for mating signals to reach the central brain.

LNvs are postsynaptic targets of ppk+ neurons
Our observations suggest that SPR activation mostly in ppk+ neurons alters the temporal organization of rest-activity cycles in mated females inducing the loss of morning anticipation, a feature regulated by the circadian clock. We next wondered how the signal provided by ppk+ neurons would reach the circadian network. Thus, we first analyzed the expression pattern of the ppk-Gal4 driver in adult females by expressing a membrane-bound green fluorescent protein (UAS-mCD8-GFP) under the control of ppk-Gal4. We observed GFP expression in the reproductive tract, in the abdominal ganglia as well as in a few somas in the dorsomedial region of the central brain (Fig 3). To visualize putative dendritic and axonal terminals of ppk+ neurons, both DenMark, a specific somatodendritic marker [31] and synaptotagmin (syt)-GFP, a presynaptic marker localized to synaptic vesicles [32], were expressed in mated females. ppk+ neurons displayed strong labelling of presynaptic syt-GFP, in the subesophageal ganglion zone (SEZ), and in the dorsal protocerebrum where they are in a close apposition to pdf+ terminals. Also, the somatodendritic compartment of ppk+ neurons displayed specific labelling in the dorsal protocerebrum and the SEZ (Fig 4A-4C and S1 Video). Then, to explore whether ppk+ neurons could provide direct input to circadian neurons, we employed the anterograde trans-synaptic tracing tool trans-Tango [33] to define specific downstream synaptic partners of ppk+ neurons. Expression of the tethered trans-Tango ligand under a Gal4 neuronal pattern of choice triggers mtd-Tomato expression in postsynaptic targets. We co-expressed the trans-Tango ligand and GFP to label pre-synaptic ppk+ neurons, and mtd-Tomato in the whole brain, in males, virgin and mated females in the event there were sexual and/or postmating differences in postsynaptic connectivity. Trans-synaptic labeling revealed that pdf+ ventral lateral neurons, both the l-LNvs and s-LNvs, are postsynaptic targets to ppk+ cells in the three experimental groups (Figs 4D-4F and S3). We also observed a clear postsynaptic mtdTomato labeling in several unidentified neurons within the suboesophageal ganglia in male and female brains (Figs 4D-4F and S3). The subesophageal ganglion is a region within the CNS that is likely to contain circuits that mediate behavioral responses to mating [17,18]. In addition, it has been reported that ppk+ projections are in close proximity to the somas of DN1 clock neurons, which are required to control the timing (onset) of the siesta in response to temperature [29]. Although trans-Tango provided evidence of direct synaptic contact between ppk+ and pdf+ neurons, it failed to detect postsynaptic labeling within DN1 somas as previously reported, [29] despite additional-yet unidentified-postsynaptic targets became apparent at the dorsal protocerebrum.
Overall, these results confirm a contact between ppk+ and pdf+ neurons suggesting a direct interaction between circuits involved in reproduction and the circadian clock. We next inquired what would be the impact of this communication on the circadian clock.

Mating reduces PDF levels in females
The sLNvs and ILNvs are required for normal circadian behavior under free running conditions and are the only neurons within the circadian network that express the PDF neuropeptide [4][5][6]. PDF levels at the dorsal sLNv terminals as well as in the somas oscillates in a circadian fashion; at dawn, levels are high while at dusk they are low [34]. PDF released from the sLNvs appears to be responsible for the maintenance of free-running activity rhythms [35].  Ablation of the LNvs and/or PDF results in the loss of morning anticipation, an advance in the evening activity peak under LD cycles, and a decrease in the free-running period [4][5][6]. Thus, we reasoned that the phenotype associated to the loss of morning anticipation in mated females could possibly involve alterations in PDF levels, cycling, or both. To test this idea, we evaluated PDF levels by performing immunofluorescence in whole brains of mated and virgin females as well as in males. Fig 5A-5F shows that PDF immunoreactivity in males and virgin females displays a normal cycling pattern; however, PDF levels at the axonal termini are particularly reduced in mated females, especially in the morning (albeit some residual cycling is still observed), suggesting that the mating state alters the circadian modulation of PDF levels ( Fig  5G). To confirm whether reduced PDF levels in mated females could be mediated by SP signaling we knocked-down SPR in ppk+ neurons. Fig 5H show that this restores PDF cycling in mated females and causes a significant increase of PDF levels in the morning when compared to mated controls. In fact, Fig 5H also shows that PDF levels are like those observed in matched genetic controls as well as in ppk-Gal4>SPR-IR1 males. Surprisingly, we also noticed that virgin females devoid of SPR in ppk+ neurons displayed a significant decrease in PDF levels when compared to control virgin females. Overall, the results for mated females indicate that PDF levels are responsive to postmating regulation in females.

Discussion
In most animals, many behaviors display a high degree of temporal organization, even in the absence of any temporal cues from the environment, which is a clear indication of the presence of an endogenous circadian clock. Fruit flies have two daily bouts of consolidated activity, the first of which starts some time before lights on, under laboratory conditions, a property that is known as morning anticipation. Morning anticipation is a trait that has been extensively characterized in Drosophila males [36]. However, it has not been explored in much depth in females. Particularly, we noticed that virgin females display less consolidated morning anticipation compared to males (Fig 1), which contributes to a certain degree of variability when assessing this trait: any single day does not robustly describe the ability to anticipate the coming transition. However, when this trait is scored over the course of several days, morning anticipation is indeed present in virgin females (Fig 1C). After mating females display important changes in their behavioral repertoire, such as an increase in the oviposition rate and a reduction of daytime sleep [11][12][13][14]. We show here that the temporal organization of locomotor behavior is also significantly altered after mating, since females lose their ability to anticipate the incoming morning (Fig 1). As it has been described with most postmating responses [17][18][19], such loss of anticipation can probably be related to the transfer of the sex peptide during copulation. It has been shown that many neurons have sex peptide receptors, which gives them the ability of initiating various postmating responses. Here we describe that the spr+ ppk+ neurons are responsible for the suppression of morning anticipation. Furthermore, we show that the SPR activation in these neurons correlates with a decrease in the concentration of PDF, a key circadian neuropeptide, which is known to be actively involved in clock control of the morning peak of activity in Drosophila.

Suppression of morning anticipation as a postmating response
Even though during copulation, males transfer more than 100 proteins to receptive females [37], SP is largely responsible for most postmating changes described in Drosophila. Most SPdependent responses, including the loss of morning anticipation described here, are mediated by a small group of sensory neurons (SPSN) located within the female genital tract that coexpress ppk, dsx and fru genes [17][18][19]. However, the diverse properties of neurons that

PLOS GENETICS
Loss of morning anticipation as a post mating response in flies separately express ppk, fru or dsx make it unlikely that the SP response is only regulated by neurons that co-express the three genes. In fact, egg laying and receptivity are differently affected by manipulations of subsets of these neurons [17][18][19][20]30,38]. This appears to be the case with the loss of morning anticipation after mating. Indeed, our results show that this PMR is also mediated by the action of SPR in ppk+ neurons, since silencing SPR expression in them restores to a greater extent the ability to anticipate light/dark transitions in mated females. In SPSN, fru+ or dsx+ neurons, SPR downregulation achieved a much smaller effect, pointing to a more relevant SPR function in ppk+ neurons for this behavior (Fig 2). On the other hand, when we analyzed another PMR such as the loss of daytime sleep [22], SPR knock down in ppk+ and SPSN neurons produces the same daytime sleep recovery (S2 Fig). These results reinforce the idea that distinct SPR neurons regulate different postmating responses [20,39].
An intriguing question is how the signals triggered by mating reach higher-order neurons in the brain to coordinate the sensory integration of the postmating response. Mating signals can act by two major pathways [20,30]. One is through SPSN neurons that can detect SP and alter its activation rate accordingly. This propagates the mating signal to the abdominal ganglia where, through direct synaptic contact, they silence the SAG neurons, which in turn relay mating information to the brain [17][18][19]30]; alternatively, the sex peptide can enter the hemolymph and act in higher centers of the brain [20]. Very recently, it was shown that this last pathway is being used to transmit mating information to the brain to regulate female receptivity [39]. In this work we suggest an additional PMR that could be using, at least partially, this second pathway through which SP could induce a postmating response: SPR activation in ppk+ neurons, probably in the brain, provides synaptic inputs to pdf+ neurons that would then drive morning anticipation in a manner dependent both on the clock and on mating status. Interestingly, we also observed this connection between ppk+ and pdf+ neurons in male brains, underscoring that this connection is not a sexually dimorphic feature (Figs 4 and S3).
The exact identity of the ppk+ neurons that are presynaptic to pdf+ neurons could not be determined since the ppk-Gal4 driver employed is expressed in the reproductive tract, in the abdominal ganglia as well as in some brain somas (Fig 3). However, our data (Fig 4 and S1 Video) strongly suggests that some of the presynaptic contacts observed might correspond to projections from ppk+ neurons in the brain. Interestingly, very recently it was shown that ppk+ neurons in the brain control receptivity in mated females [39]. Thus, it is tempting to hypothesize that ppk+ neurons in the brain can also control, at least partially, the suppression of morning anticipation. Further work is necessary to pinpoint which specific ppk+ neurons contact pdf+ neurons directly.

SP receptor plays a dual role in the temporal organization of locomotor behavior
The optimal time of day to engage in a particular behavior can vary depending upon environmental factors, and according to the internal physiology of the animal. In Drosophila, PDF differentially coordinates the activity of circadian neuronal groups to optimize behavioral output [5,7,[40][41][42]. PDF immunoreactivity at the axonal terminals of the sLNv oscillates in a circadian fashion [34]. We show here that mated females have reduced levels of PDF compared with virgin females and males, and these levels can be restored when SPR expression is reduced in ppk+ neurons (Fig 5). This is expected because SP activates the inhibitory G-protein coupled receptor (GPCR) SPR in the SPSN, which upon activation induces PMR by silencing the SPSN directly and the SAG neurons indirectly [30]. Additionally, we hypothesize that some ppk+ feed excitatory synaptic inputs to pdf+ neurons, and that the presence of SP silences ppk+ neurons, which in turn weakens or suppresses excitatory inputs to pdf+ neurons, inducing a decrease in PDF levels in the dorsal terminals [43]. Further work will be necessary to confirm this hypothesis.
In virgin females PDF cycling/levels resembles the cycling shown in males; however, SPR downregulation in ppk+ neurons results in decreased PDF levels, in contrast to the effect observed in mated females (Fig 5). Although understanding this regulation is beyond the scope of the present manuscript, it is tempting to speculate that reduced SPR levels impairs the binding of additional neuropeptide/s that might also contribute to the neuronal communication among ppk+ and pdf+ neurons. This putative neuropeptide would likely be a GPCR ligand, just as SP is, but it may recruit different signaling pathways downstream of SPR. One attractive candidate is the myoinhibitory peptide (Mip), a potent agonist for SPR [44,45]. Like other neuromodulators, Mip is highly pleiotropic, and it has been shown to modulate behaviors as diverse as sleep, feeding and mating receptivity [46][47][48]. SPR mediates the sleep function of Mip but is dispensable for its feeding function and normal mating in virgin females [47,48]. These findings should be thoroughly characterized in the future, as they suggest a different regulation of the excitability of sLNv through ppk+ neurons in virgin and mated females.
To the best of our knowledge, the loss of morning anticipation is the first postmating response that can be clearly ascribed to the circadian clock. The obvious question that arises is what could be the benefit of losing the ability to anticipate the end of the night. Fujii and colleagues (2007) showed that male-female couples are highly active throughout the night and early morning, and this locomotor activity rhythm is associated with courtship [49]. Thus, it is possible that, once mated, females lose the ability to anticipate dawn in order to reduce the chance of encounters with other males thus saving their energy for the daytime hours, which are probably better suited for feeding and oviposition activities, including searching for egglaying sites. More generally, it is tempting to hypothesize that both the loss of morning anticipation and the suppression of the siesta could be part of a larger strategy of downregulating the circadian clock after mating, in order to restrict activity to daylight hours-whenever they come. Further confirmation of this hypothesis would require experiments to ascertain the preference for daytime over nighttime for the typical activities displayed by mated females (such as oviposition, feeding, searching for suitable egg-laying sites, etc.). Establishing the ecological relevance of the suppression of morning anticipation is particularly difficult in the case of natural conditions because the transition to lights-on is continuous, complicating the definition of morning anticipation. A similar observation can be made regarding the relevance of the suppression of the siesta, since under seminatural conditions flies show an afternoon peak at approximately the same times when the siesta is observed under laboratory conditions [50,51]. In fact, it will be interesting to study how these PMRs appear in the case of seminatural conditions.
In our opinion, the main value of this new PMR (suppression of morning anticipation) lies in its unambiguous relationship to the endogenous clock, which makes it a useful tool to probe the influence of mating on the female circadian clock. Other postmating responses, although stronger, do not have such a clear relationship with the circadian clock. For example, the suppression of the siesta evidently depends on the system that regulates sleep, which in turn depends not only on circadian but also on homeostatic processes [24].
As further extensions of this work it will be interesting to study the dependence of this PMR with temperature, and with time. After the initial suppression of the siesta, mated females begin to recover this ability after about 7 days [14]. We monitored the loss of morning anticipation for 4 days after male removal and did not observe any decrease in this PMR, but it would be interesting to study whether it disappears after a longer period of time.
To summarize, we show here that mating impairs the ability to anticipate dawn in females. This is probably also achieved by SPR-mediated silencing a subset of ppk+ neurons, which in turn acts on the circadian release of PDF, thus obliterating a major signal that times locomotor activity to specific windows along the day. In nature, signaling of a wide range of sensory modalities along with internal cues must concomitantly be considered to match the onset of activity with environmental conditions. Our work provides a framework to unravel how mating triggered signals impinge upon clock neurons in the Drosophila nervous system and modify the dynamic control of activity.

Fly strains
All fly strains used in this study are detailed in Table 1. Flies were reared and maintained on standard cornmeal/agar medium at 25˚C and 60% humidity in a 12 hr:12 hr LD cycle unless stated otherwise.
Per vial, six 0-5 day-old females were mated with 3 males during 72 h. After that period males were discarded and mated females were used for locomotor experiments. 5-8 day-old adult males, virgin or mated females were used for all locomotor activity experiments.

Video-based acquisition systems and locomotor behavioral analysis
Flies were entrained to 12:12h LD cycles during their entire development, and males, virgin and mated females were individually housed in open ended transparent chambers measuring 80 x 8 x 8 mm, containing approx. 1ml of banana medium [54] in one end and a cotton plug in the other end. A collective enclosure containing 26 of such chambers was built with two transparent acrylic boards (forming the floor and roof of all chambers) and white-opaque acrylic separations between chambers (to avoid visual contact between flies). The enclosures were placed inside an incubator (set at 25˚C) over a translucid (not transparent) white plaque, and were illuminated from below with an array of white and infrared LEDs (850nm), in order to record activity both in LD and in constant darkness. Each enclosure was recorded from a distance of 18 cm, with two webcams whose infrared filters were manually removed.
Locomotor activity was monitored for 3-4 days in LD conditions. Data from the webcams was analyzed in a laptop computer (running Ubuntu, a Linux distribution) using custom made software (written in Python3 and using OpenCV libraries). The software implements a tracking paradigm: from the video signal the position of each fly is extracted in real time. The output is a text file containing a pair of coordinates (x, y) for each fly, sampled at one second intervals. These files are then processed with an analysis software we developed (in Bash) which provides statistics for activity (distance traveled, morning anticipation indexes, etc.) and sleep (daytime and nighttime sleep duration, number and duration of sleep bouts, etc.).
Sleep is defined as the absence of "significant activity" (defined as a displacement of at least one body length per second) for at least 5 consecutive minutes. The Morning Anticipation Index (MAI) is defined as the ratio between the total activity in ZT21-24 and the total activity in ZT 18-24 [26]. Given that there is a large variability in the MAI across different days in individual flies, we averaged the MAI of the first three complete days for every experiment for a more robust quantitation. All the software used is open-source and freely available upon request.

Immunofluorescence detection
Adult flies were fixed with 4% p-formaldehyde (pH 7.5) for 60 min at room temperature. Brains were dissected and rinsed six times in PT buffer (PBS with 0.1% Triton X-100) for 30 min. Samples were incubated with rat anti-PDF (1:500; (45)) in 7% normal goat serum at 4˚C for two days. Next, samples were washed in PT 6x10 min, and incubated with Cy5-conjugated anti-rat (1:500; Jackson ImmunoResearch, USA) for 2h at room temperature. Samples were washed 4x15 min in PT and mounted in Vectashield antifade mounting medium (Vector Laboratories, USA). For Trans-Tango staining ppk-Gal4 males were crossed with trans-Tango females and kept at 25˚C. Immediately after eclosion, adult males, virgin and mated females were separated from the progeny and aged for 15 days at 18˚C. The immunofluorescence procedure was the same as described above, except for the length of the incubation with primary antibody, which was extended to 5 days at 4˚C. The following primary antibodies were used:

PDF levels quantification
For the quantification of PDF intensity at the sLNv projections, we assembled a maximum intensity z-stack that contains the whole projection (approximate 10 images) and constructed a threshold image to create a ROI to measure immunoreactivity intensity using ImageJ (NIH) [43]. Data was analyzed with GraphPad Prism.

Statistical analysis
The following statistical analyses were used in this study: one-way ANOVA and two-way ANOVA with post hoc Tukey's or Holm-Sidak's test for multiple comparisons of parametric data, and non-parametric Kruskal-Wallis statistical analysis with multiple comparisons as specified in figure legends. Parametric tests were used when data were normally distributed and showed homogeneity of variance, tested by D'Agostino & Pearson test. When data was not normally distributed we applied a log transformation, and checked again for normality. Sidak's and Dunn's multiple comparisons tests were performed after parametric and nonparametric ANOVA when GraphPad software was used. A p value < 0.05 was considered statistically significant. Throughout the manuscript n represents the total number of measurements compared in each experimental group (behaviour of an individual or brain), and N represents the number of independent times an experiment was repeated. In dot plots for MAI, daytime sleep and immunofluorescence quantification lines represent the mean value; error bars depict the standard error of the mean. No statistical methods were used to determine sample size. Sample sizes are similar to those generally used in this field of research. Samples were not randomized and analyzers were not blind to the experimental conditions.
In all the figures we show results of two or three independent experiments.